package org.unicat.serviceedu.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.unicat.commonutils.R;

@RestController
@RequestMapping("/eduservice/user")
@Api(tags = "用户登录")
@CrossOrigin    // 解决跨域问题
public class EduUserController {

    // login
    @PostMapping("/login")
    @ApiOperation(value = "登录")
    public R login() {
        return R.ok()
                .data("token", "admin");
    }

    // info
    @GetMapping("/info")
    @ApiOperation(value = "用户信息")
    public R info() {
        return R.ok()
                .data("roles", "[admin]")
                .data("name", "admin")
                .data("avatar", "http://localhost:8001/img/anime.jpg");
    }

}
